/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.jprvyd;

import java.util.Date;
import java.util.List;

/**
 *
 * @author tom
 */
public interface InvoiceManager {
    
    /**
     * Creates new invoice
     * 
     * @param invoice
     * @throws IllegalEntityException 
     */
    public void createInvoice(Invoice invoice) throws IllegalEntityException;
    
    /**
     * Removes an existing invoice
     * 
     * @param id 
     */
    public void removeInvoice(Long id);
    
    /**
     * Updates an existing invoice
     * 
     * @param invoice
     * @throws IllegalEntityException 
     */
    public void updateInvoice(Invoice invoice) throws IllegalEntityException;
    
    /**
     * Retrieves an invoice by id
     * 
     * @param id
     * @return 
     */
    public Invoice getInvoiceById(Long id);
    
    /**
     * Retrieves invoice by its number
     * 
     * @param number
     * @return 
     */
    public Invoice getInvoiceByNumber(int number);
    
    /**
     * Retrieves invoices by contact
     * 
     * @param contact
     * @return 
     */
    public List<Invoice> getInvoicesByContact(Contact contact);
    
    /**
     * Retrieves invoices by date
     * 
     * @param date
     * @return 
     */
    public List<Invoice> getInvoicesByDate(Date date);
    
    /**
     * Retrieves invoices by get date
     * 
     * @param date
     * @return 
     */
    public List<Invoice> getInvoicesByGetDate(Date date);
    
    /**
     * Retrieves invoice by variable symbol
     * 
     * @param variableSymbol
     * @return 
     */
    public Invoice getInvoiceByVariableSymbol(int variableSymbol);
    
    /**
     * Retrieves invoices by payment method
     * 
     * @param paymentMethod
     * @return
     * @throws IllegalEntityException 
     */
    public List<Invoice> getInvoicesByPaymentMethod(PaymentMethod paymentMethod) throws IllegalEntityException;    
    
    /**
     * Retrieves all invoices
     * 
     * @return 
     */
    public List<Invoice> getAllInvoices();
    
    /** 
     * Retrieves a total sum of all invoices
     * 
     * @return 
     */
    public int getSumTotal();
}
